package dao.reader.impl;

import dao.BaseDao;
import dao.reader.MessageDao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * MessageDaoImpl
 *
 * @author lenovo
 * @since 2023/8/31
 */
public class MessageDaoImpl extends BaseDao implements MessageDao {
    @Override
    public ResultSet executeQuery(String sql) {
        Connection conn = getConnection();
        PreparedStatement pstmt = null;
        ResultSet rs = null;
        try {
            pstmt = conn.prepareStatement(sql);
            rs = pstmt.executeQuery();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return rs;
    }
}
